package livesun.justiceeternal.view;

import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.View;

import com.tencent.smtt.sdk.WebView;

/**
 * 类描述：
 * 创建人：livesun
 * 创建时间：2018/1/5.
 * 修改人：
 * 修改时间：
 * github：https://github.com/livesun
 */
public class X5WebViewSwipeRefreshLayout  extends SwipeRefreshLayout {
    public X5WebViewSwipeRefreshLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    public boolean canChildScrollUp() {
        View child = getChildAt(0);
        if (child != null && child instanceof WebView) {
            View scrollView = ((WebView) child).getChildAt(0);
            if (scrollView != null)
                return scrollView.getScrollY() != 0;
        }
        return super.canChildScrollUp();
    }
}
